﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace _04_数据模板
{
	/// <summary>
	/// Interaction logic for MainWindow.xaml
	/// </summary>
	public partial class MainWindow : Window
	{
		public MainWindow()
		{
			InitializeComponent();

			//List<int> list = new List<int>();
			//for (int i = 0; i < 5; i++)
			//{
			//	list.Add(i);
			//	//listBox.Items.Add(new ListBoxItem()
			//	//{
			//	//	Content = new TextBlock()
			//	//	{
			//	//		Text = i.ToString()
			//	//	}
			//	//});
			//	//listBox.Items.Add(i);
			//}
			//listBox.ItemsSource = list; 


			List<Color> listColor= new List<Color>();
			listColor.Add(new Color() { Code = " #FF5151", Name = "红" });
			listColor.Add(new Color() { Code = " #005AB5", Name = "蓝" });
			listColor.Add(new Color() { Code = " #019858", Name = "绿" });
			listColor.Add(new Color() { Code = " #73BF00", Name = "深绿" });
			listColor.Add(new Color() { Code = " #D26900", Name = "橙红" });
			listBox.ItemsSource = listColor; 





		}
	}

	public class Color
	{
		public string Code { get; set;}
		public string Name { get; set;}	
	}


}
